package ${packageName};
/**
* @ClassName ${tableInfo.firstUpperEntityName}
* @Description ${tableInfo.tableComment}
* @Author dean
* @Date 2021/10/3 10:03
*/
public class ${tableInfo.firstUpperEntityName} {
<#list tableFields as tableField>

    /**
    * ${tableField.fieldComment!''}
    */
    private ${tableField.fieldType} ${tableField.fieldName};
</#list>
<#list tableFields as tableField>

    private final String ${tableField.columnName!''}="${tableField.columnName!''}";
</#list>

<#list tableFields as tableField>

    public ${tableField.fieldType} get${tableField.firstUpperFieldName!''}() {
        return ${tableField.fieldName!''};
    }

    public void set${tableField.firstUpperFieldName!''}(${tableField.fieldType} ${tableField.fieldName}) {
        this.${tableField.fieldName} = ${tableField.fieldName};
    }
</#list>
    /**
    * 设置指定的字段信息
    * @param fieldName
    * @param fieldValue
    */
    public void set(String fieldName,String fieldValue){
        fieldName = fieldName.toUpperCase();
        switch (fieldName){
        <#list tableFields as tableField>
            case ${tableField.columnName!''}:
                <#if (tableField.fieldType??)&&(tableField.fieldType == "String")>
                    set${tableField.firstUpperFieldName!''}(fieldValue);
                <#else>
                    set${tableField.firstUpperFieldName!''}(fieldValue == null? new ${tableField.fieldType}(fieldValue));
                </#if>
                break;
            }
        </#list>
        default:
            break;
        }
    }
}
